package com.pxx.pj.pxx.dao;

import com.pxx.pj.common.pojo.CheckBox;
import com.pxx.pj.pxx.pojo.PxxDepts;
import com.pxx.pj.pxx.pojo.PxxUser;
import com.pxx.pj.pxx.pojo.PxxUserDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface PxxUserDao {

    @Update("update pxx_users set password=#{newPassword},salt=#{newSalt},modifiedTime=now() where username=#{username}")
    int updatePassword(String username,String newPassword,String newSalt);


    @Select("select * from pxx_users where username=#{username}")
    PxxUser findUserByUserName(String username);


    int updateObject(PxxUser entity);

    PxxUserDept findObjectById(Integer id);




    int insertObject(PxxUser entity);



    //基于用户id，修改用户状态信息
    int validById(Integer id,Integer valid,String modifiedUser);

    int getRowCount(String username);

    List<PxxDepts> findPageObjects(String username, Integer startIndex, Integer pageSize);
}
